package com.europe.business.europebusiness.ui.net;

import com.europe.business.europebusiness.ui.bean.CompanyCategoryBean;
import com.europe.business.europebusiness.ui.bean.JsonBean;
import com.europe.business.europebusiness.ui.bean.RegReqBean;
import com.europe.business.europebusiness.ui.bean.User;
import com.europe.business.europebusiness.ui.bean.UserLogin;

import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * 用户相关接口
 */
public interface IUser {
    @POST("app/user/login")
    public Call<UserLogin> login(@Query("name") String name, @Query("password") String passw, @Query("language") String language);

    @POST("app/user/login")
    public Call<UserLogin> login1(@Body User user);

    @POST("app/user/verifyPhoneOrEmailMessage")
    public Call<JsonBean> getCode(@Query("phoneOrEmail") String phoneOrEmail, @Query("language") String language);

    @POST("app/user/register")
    public Call<UserLogin> register(@Query("mobile") String mobile, @Query("verifyCode") String verifyCode,
                                    @Query("password") String password, @Query("type") int type, @Query("language") String language);
    @FormUrlEncoded
    @POST("app/user/register")
    public Call<UserLogin> register(@FieldMap Map<String, String> map);

    @POST("app/user/register")
    public Call<ResponseBody> register(@Body RegReqBean bean);

    @FormUrlEncoded
    @POST("app/user/register")
    @Headers("Content-Type:application/x-www-form-urlencoded;charset=utf-8")
    public Call<ResponseBody> register1(@Field("mobile") String mobile, @Field("verifyCode") String verifyCode,
                                        @Field("password") String password, @Field("type") int type, @Field("language") String language);

    @Multipart
    @POST("app/user/uploadLogo")
    public Call<JsonBean> uploadLogo(@Part MultipartBody.Part file, @Part("language") String language);
}
